package org.finesys.chat.core.base.embedding.store.pgvector.constants;

/**
 * 索引类型枚举
 * vector - up to 2,000 dimensions
 * halfvec - up to 4,000 dimensions
 * bit - up to 64,000 dimensions
 * <p>
 * Specify the number of probes (1 by default)
 * SET ivfflat.probes = 10;
 * <p>
 * <p>
 * Speed up index creation on large tables by increasing the number of parallel workers (2 by default)
 * SET max_parallel_maintenance_workers = 7; -- plus leader
 * <p>
 * indexing progress:
 * SELECT phase, round(100.0 * tuples_done / nullif(tuples_total, 0), 1) AS "%" FROM pg_stat_progress_create_index;
 */
public enum IVFFlatIndexEnum {

    L2_DISTANCE("vector_l2_ops", "L2 distance"),
    INNER_PRODUCT("vector_ip_ops", "Inner product"),
    COSINE_DISTANCE("vector_cosine_ops", "Cosine distance"),
    HAMMING_DISTANCE("bit_hamming_ops", "Hamming distance");

    private String value;
    private String name;

    IVFFlatIndexEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }
}
